<template>
     <header>

<!-- header-message -->
<head_message v-if="!ifdelheadmessage ? headmessage : false" :headmessage="headmessage" @closemsg="closemsg"></head_message>
<!-- header-message-end -->

<!-- header-top-start -->
<header_top_start></header_top_start>
<!-- header-top-end -->

<!-- header-search-area -->
<header_search></header_search>
<!-- header-search-area-end -->

<head_navigation></head_navigation>


</header>
</template>

<script>


import head_message from './part/head_message';
import header_top_start from  './part/header-top-start'
import header_search from './part/header-search'
import head_navigation from './part/head-navigation'
import { getheadmessage } from '@/api/head';
import { isNoNullOrUndefind } from '@/utils/utils';
export default {
  beforeCreate() {
    this.$store.dispatch('customer/refreshpage')
    if(!this.ifdelheadmessage){ 
      getheadmessage().then(msg=>{
          this.headmessage=msg
      })
    }
  },
    created() {
   
    },
    data() {
        return {
           headmessage:null,
           ifdelheadmessage:isNoNullOrUndefind(window.sessionStorage.getItem('delheadmessage')) ,
        }
    },
  computed:{
    
  },
  methods: {
    closemsg(){
      // console.log('关闭信息')
      this.ifdelheadmessage=true
      this.headmessage=null
      window.sessionStorage.setItem('delheadmessage',true)
    }
  },
    components:{
        head_message,
        header_top_start,
        header_search,
        head_navigation,
    },
   
    
}
</script>

<style>

</style>